package com.gupao.pattern.delegatestrategy.demo.strategy;

public abstract class Payment {

    abstract String getName();

    abstract double getBalance();

    void doPay(double cost) {
        System.out.println("欢迎使用" + getName());
        if (getBalance() < cost) {
            System.out.println("余额不足");
        }
        System.out.println("开始付款：" + cost);
        System.out.println("余额：" + (getBalance() - cost));

    }

}
